import java.util.Scanner;
//long类型+sqrt方法无需循环
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long x = in.nextLong();
        long t = (long)Math.sqrt(x);
        System.out.print((t+1)*(t+1)-x<x-t*t?(t+1)*(t+1):t*t);
    }
}